 <%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="../common/tags.jsp" %>  
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script type="text/javascript">
function checkSubmitData(obj){
	if (!iu1.validate()) {
		alert("您还有像素为：【"+iu1.need_add_pic_pixel.join(",")+"】的图片要添加，请添加图片！");
		iu1.openAddImgFrame();
		return false;
	}
	return validateCallback(obj, navTabAjaxDone);
}

function checkIsSupport(isSupport){
   if(isSupport){
   		$("#balanceUrl").hide();
   }else{
   		$("#balanceUrl").show();
   }
}
</script>
<script type="text/javascript" src="<%=path%>/projectjs/regioninfo.js" ></script>
<script src="<%=path %>/js/dwz.tab.js" type="text/javascript"></script>
<script type="text/javascript" src="<%=path%>/projectjs/ImageFileUpload.js"></script>
<div class="pageContent">
	<div class="tabs" currentIndex="0" eventType="click">
		<div class="tabsHeader">
			<div class="tabsHeaderContent">
				<ul>
					<li><a href="javascript:;"><span>基本信息</span></a></li>
					<!--<li><a href="<%=path %>/customerAccount/editCustomerAccount.action?customerAccountVO.customerCode=" class="j-ajax"><span>账户信息</span></a></li>  -->
					<li><a><span>店面信息</span></a></li>
				</ul>
			</div>
		</div>
		<div class="tabsContent" style="height:502px;">
			<div class="pageContent">
			<form method="post" action="<%=path %>/customer/saveCustomer.action" class="pageForm required-validate" onsubmit="return checkSubmitData(this);">
				<input type="hidden" name="customerVO.cooperationStaus" value="1"/>
				<div class="pageFormContent" layoutH="90">
					<p>
						<label>商家编码：</label>
						<input name="customerVO.code" value="<s:property value="customerVO.code" />" class="required" readonly="readonly" type="text" size="30" alt="请输入商家编码"/>
					</p>
					<p>
						<label>商家名称：</label>
						<input name="customerVO.name" value="<s:property value="customerVO.name" />" class="required" type="text" size="30" alt="请输入商家名称"/>
					</p>
					<p>
						<label>合同编码：</label>
						<input name="customerVO.contractCode" value="<s:property value="customerVO.contractCode" />" class="" type="text" size="30" alt="请输入合同编码"/>
					</p>
					<p>
						<label>加盟开始时间：</label>
						<input name="customerVO.joinBegtime" value="<s:property value="customerVO.joinBegtime" />" class="date" type="text" size="30"/>
					</p>
					<p>
						<label>加盟结束时间：</label>
						<input name="customerVO.joinEndtime" value="<s:property value="customerVO.joinEndtime" />" class="date" type="text" size="30"/>
					</p>
					<p>
						<label>联系人：</label>
						<input name="customerVO.linkman" value="<s:property value="customerVO.linkman" />" class="" type="text" size="30" alt="请输入联系人"/>
					</p>
					<p>
						<label>固定电话：</label>
						<input name="customerVO.telphone" value="<s:property value="customerVO.telphone" />" class="" type="text" size="30" alt="请输入固定电话"/>
					</p>
					<p>
						<label>移动电话：</label>
						<input name="customerVO.mobile" value="<s:property value="customerVO.mobile" />" class="" type="text" size="30" alt="请输入移动电话"/>
					</p>
					<p>
						<label>是否有优惠券：</label>
						<s:select name="customerVO.haveFavourable"
								list="%{#{1:'是',0:'否'}}" listKey="key" listValue="value" ></s:select>
					</p>
					<p>
						<label>是否支持联盟优惠：</label>
						<s:select name="customerVO.haveAllianceFavourable"
								list="%{#{1:'是',0:'否'}}" listKey="key" listValue="value" ></s:select>
					</p>
					<p>
						<label>是否核心商家：</label>
						<s:select name="customerVO.isCoreCustomer"
								list="%{#{1:'是',0:'否'}}" listKey="key" listValue="value" ></s:select>
					</p>
					<p>
						<label>所属省份：</label>
						<select name="customerVO.province.regionId" id="customerAdd_province_id" onchange="getAllCity('customerAdd')" class="required">
							<option value="-1">请选择</option>
	              		</select>
					</p>
					<p>
						<label>所属市级：</label>
						<select name="customerVO.city.regionId" id="customerAdd_city_id" onchange="getAllDistrict('customerAdd')" class="required">
							<option value="-1">请选择</option>
	              		</select>
					</p>
					<p>
						<label>所属城区：</label>
						<select name="customerVO.district.regionId" id="customerAdd_district_id" class="required">
							<option value="-1">请选择</option>
	              		</select>
					</p>
					<p>
						<label>商家分类：</label>
						<select name="customerVO.customerKindId" >
							<option value="-1">请选择</option>
							<s:iterator value="customerKindList" id="customerKind" status="st">
								<option value="<s:property value="id" />"${customerVO.customerKindId==customerKind.id?" selected":""}><s:property value="name" /></option>
							</s:iterator>
	              		</select>
					</p>
					<p>
						<label>其他余额积分来源：</label>
						<input id="balanceUrl"  name="customerVO.balanceUrl" value="<s:property value="customerVO.balanceUrl" />" type="text" size="30" alt="请输入余额来源URL"/>		
					</p>
					<p>
						<label>其他计次来源：</label>
						<input id="countUrl"  name="customerVO.countUrl" value="<s:property value="customerVO.countUrl" />" type="text" size="30" alt="请输入计次来源URL"/>		
					</p>
					<div class="divider" style="border:0"></div>
						<dl class="nowrap">
							<dt>商家介绍：</dt>
							<dd>
							<textarea class="textInput" rows="2" cols="80" name="customerVO.introduce" style="width: 510px; height: 80px;"><s:property value="customerVO.introduce" /></textarea>
							</dd>
						</dl>
					<div class="divider" style="border:0;"></div>
						<dl class="nowrap">
							<dt>会员福利：</dt>
							<dd>
							<textarea class="textInput" rows="2" cols="80" name="customerVO.memberBenefits" style="width: 510px; height: 80px;"><s:property value="customerVO.memberBenefits" /></textarea>
							</dd>
						</dl>
					<div class="divider" style="border:0"></div>
						<dl class="nowrap">
							<dt>商家图片：</dt>
							<dd>
							<a class="button" onclick="openAddImgFrame(1);"><span>添加图片</span></a>
							<a id="add_pic_a_id1" class="btnAttach" href="<%=path%>/jsp/common/image_file_upload.jsp" lookupGroup="" width="560" height="300" style="display: none"></a>
							<div class="divider" style="border:0"></div>
							<div id="pic_need_add_pixel_div1"></div>
							<div class="divider" style="border:0"></div>
							<div id="pic_content_div1" style="float: none;width:auto;padding-left: 150px;"></div>
							</dd>
						</dl>
				</div>
				<div class="formBar">
					<ul>
						<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
						<li>
							<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
						</li>
					</ul>
				</div>
			</form>
		</div>
			<div>
				请先创建商家
			</div>
		</div>
		
	</div>
</div>
<script type="text/javascript">
	var iu1 = new ImageUpload("","customer","1","${pageContext.request.contextPath}","customerVO.picName","173_117");
	//getAllProvince("${pageContext.request.contextPath}","customer_province_id","customer_db_province_id","customer_city_id","customer_db_city_id","customer_district_id","customer_db_district_id");
	var customerAdd=new RegionInfo("${pageContext.request.contextPath}","customerAdd_province_id","customerAdd_db_province_id","customerAdd_city_id","customerAdd_db_city_id","customerAdd_district_id","customerAdd_db_district_id","customerAdd");
</script>